package cn.java.Concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @author 小石潭记
 * @date 2021/12/19 10:22
 * @Description: ${todo}
 */
public class Run1 {
    public static void main(String[] args) {
        try {
            Runnable runnable = () -> System.out.println("打印的信息");
            ExecutorService executorService = Executors.newCachedThreadPool();
            Future<?> future = executorService.submit(runnable);
            System.out.println("结果" + future.get() + "是否完成" + future.isDone());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
